package com.examples;

import toman.Index;
import toman.orm.TO;

@TO(
    id = "p.id=:photoId",
    read = "select p.id, p.name, p.description, p.album.name from Photo p",
    write = "update Photo p set p.name=:photoName, p.description=:photoDescription")
public class BasicPhotoAlbumTO {

    @Index(0)
    private int photoId;
    @Index(1)
    private String photoName;
    @Index(2)
    private String photoDescription;

    private String albumName;

    @Index(3)
    public void setAlbumName(String albumName) {
        this.albumName = albumName + "-featured";
    }

    public String getAlbumName() {
        return albumName;
    }

    public int getPhotoId() {
        return photoId;
    }

    public void setPhotoId(int photoId) {
        this.photoId = photoId;
    }

    public String getPhotoName() {
        return photoName;
    }

    public void setPhotoName(String photoName) {
        this.photoName = photoName;
    }

    public String getPhotoDescription() {
        return photoDescription;
    }

    public void setPhotoDescription(String photoDescription) {
        this.photoDescription = photoDescription;
    }

}
